#include "dominion.h"
#include "dominion_helpers.h"
#include <string.h>
#include <stdio.h>
#include <assert.h>
#include "rngs.h"

// set NOISY_TEST to 0 to remove printfs from output
#define NOISY_TEST 1

int main() {

	// based off of testUpdateCoins  example provided for class
    int i;
    int seed = 1000;
    int numPlayer = 2;
    //int maxBonus = 10;
    //int p, r, handCount;
	int r;
    int bonus;
    int k[10] = {adventurer, council_room, feast, gardens, mine
               , remodel, smithy, village, baron, great_hall};
    struct gameState G;
    //int maxHandCount = 5;
	
	//card effect values
	int choice1 = 0;
	int choice2 = 0;
	int choice3 = 0;
	int handPos = 0;
	int test = 0;
	int passed = 0;
	
	//int testHandCount;
	int numHandCards;
	
	
	memset(&G, 23, sizeof(struct gameState));   // clear the game state
	r = initializeGame(numPlayer, k, seed, &G); // initialize a new game
	i = G.whoseTurn; // check which player is up;
	
	
	numHandCards = G.handCount[i] + 2; //set test value to num cards in hand after card played
								   //will still be equal since card is discarded after play
	
	
	test = cardEffect(smithy, choice1, choice2, choice3, &G, handPos, &bonus);
	if(test == -1){
		passed = 1;
		printf("cardtest4: FAIL - smithy, card effect return -1!\n");
	}
	
	//test enumBuys is increased
	if(numHandCards != G.handCount[i] ){
		passed = 1;
		printf("cardtest4: FAIL - smithy, cards in hand not increased!\n");
	}
	
	
	if(passed == 0){
		printf("cardtest4: smithy - All tests passed!\n");
	}

    return 0;
}